package 引用类型编程题3;

import java.util.Scanner;

public class TestStudent {
    public static Student getStudent(){
        Scanner in = new Scanner(System.in);
        System.out.println("Enter name: ");
        String name = in.nextLine();
        System.out.println("Enter gender: ");
        String gender = in.nextLine();
        System.out.println("Enter age: ");
        int age = in.nextInt();
        return new Student(name,gender,age);
    }

    public static void main(String[] args) {
        Student s = TestStudent.getStudent();
        System.out.println(s);
    }
}
